<include file="Public/header"/>

		<div id="app">
			<!-- sidebar -->
			<include file="Public/left"/>
			<!-- / sidebar -->
			<div class="app-content">
				<!-- start: TOP NAVBAR -->
				<include file="Public/headernav"/>
				<!-- end: TOP NAVBAR -->
				<div class="main-content" >
					<div class="wrap-content container" id="container">
						<!-- start: PAGE TITLE -->
						<section id="page-title">
							<div class="row">
								<div class="col-sm-7 col-md-offset-5">
									<h1 class="mainTitle">{$msgtitle}</h1>
									<span class="mainDescription">&nbsp;菜单信息</span>
								</div>
								
							</div>
						</section>
						<!-- end: PAGE TITLE -->
						<!-- start: YOUR CONTENT HERE -->
<div class="container-fluid container-fullw bg-white">
<form action="" role="form" id="form2" novalidate="novalidate" method="post">
<div class="row">
	<div class="col-md-6 col-md-offset-3 ">
	<div class="form-group">
		<label class="control-label">
			菜单名称 <span class="symbol required" aria-required="true"></span>
		</label>
		<input type="text" placeholder="填写菜单名称" class="form-control" value="{$data.title}" id="title" name="title">
	</div>
    
    <div class="form-group">
		<label class="control-label">
			上级菜单 <span class="symbol required" aria-required="true"></span>
		</label>
		<select class="form-control" id="dropdown" name="pid">
			<option value="">最上级</option>
            <volist name="list" id="vo">
			<option value="{$vo.id}" <if condition="$data.pid eq $vo['id']">selected</if> >{$vo.title}</option>
		    </volist>
		</select>
	</div>

	<div class="form-group">
		<label class="control-label">
			菜单地址 <span ></span>
		</label>
		<input type="text" placeholder="填写菜单地址(顶级菜单没有地址可不填写)" value="{$data.name}" class="form-control" id='name' name="name">
	</div>

	<div class="form-group menu_icons" <if condition="$data.pid gt 0">style="display:none"</if>>
		<label class="control-label">
			菜单图标 <span ></span>
		</label>
		<div class="clip-radio radio-primary fa-hover Primary">
			<volist name="iconlist" id='vo' key="key">
			<input type="radio" value="{$vo}" name="icon_style" id="id_{$key}"
			<if condition="$data.icon eq $vo">checked="checked"</if> >
			<label for="id_{$key}">
				<i class="{$vo}" ></i>
			</label>
            </volist>
<!-- 	style="color: #007AFF;" -->
		</div>
	</div>

	<div class="form-group " >
		<label class="control-label">
			是否是隐藏菜单 <span >隐藏菜单不在菜单栏显示例如编辑菜单（需要传递参数）</span>
		</label>
		<div class="clip-radio radio-primary fa-hover Primary">
           <if condition="$data.id gt 0">
			<input type="radio" value="0" name="is_hide" id="id_no" <if condition="$data.is_hide eq 0">checked="checked"</if> >
			<label for="id_no">
				否
			</label>

			<input type="radio" value="1" name="is_hide" id="id_yes" <if condition="$data.is_hide eq 1">checked="checked"</if> >
			<label for="id_yes">
				是
			</label>
             <else/>
             <input type="radio" value="0" name="is_hide" id="id_no" checked="checked" >
			<label for="id_no">
				否
			</label>

			<input type="radio" value="1" name="is_hide" id="id_yes" >
			<label for="id_yes">
				是
			</label>

			</if>

		</div>
	</div>

	 <div class="form-group">
		<label class="control-label">
			状态 <span class="symbol required" aria-required="true"></span>
		</label>
		<select class="form-control"   name="status">
			<if condition="$data.id gt 0">
			<option value="1" <if condition="$data.status eq 1">selected</if> >有效</option>
            <option value="0" <if condition="$data.status eq 0">selected</if> >无效</option>
            <else/>
            <option value="1">有效</option>
            <option value="0">无效</option>
            </if>
		</select>
	</div>
	
	
</div>
</div>
<div class="row">
<div class="col-md-7 col-md-offset-5">
	<input type="hidden"  value="{$data.id}" name="id">
	<button class="btn btn-primary btn-wide pull-left" type="submit">
		提交 <i class="fa fa-arrow-circle-right"></i>
	</button>
</div>
</div>											
</form>
</div>	


                  





						<!-- end: YOUR CONTENT HERE -->
					</div>
				</div>
			</div>
			<!--  FOOTER and SETTINGS -->
			
           <include file="Public/footer"/>
			<!-- end: FOOTER -->
			<!-- start: OFF-SIDEBAR -->
			
			<!-- end: OFF-SIDEBAR -->
			
		</div>
		<!-- start: MAIN JAVASCRIPTS -->

         <include file="Public/javascript"/>
		
		<!-- end: CLIP-TWO JAVASCRIPTS -->

		<!-- start: JAVASCRIPTS REQUIRED FOR THIS PAGE ONLY -->
		<script src="__PUBLIC__/bootstrap/vendor/ckeditor/ckeditor.js"></script>
		<script src="__PUBLIC__/bootstrap/vendor/ckeditor/adapters/jquery.js"></script>
		<script src="__PUBLIC__/bootstrap/vendor/jquery-validation/jquery.validate.min.js"></script>
		<!-- end: JAVASCRIPTS REQUIRED FOR THIS PAGE ONLY -->
		<!-- start: CLIP-TWO JAVASCRIPTS -->
		<!-- <script src="__PUBLIC__/bootstrap/assets/js/main.js"></script> -->
		<!-- start: JavaScript Event Handlers for this page -->
		<!--<script src="__PUBLIC__/bootstrap/assets/js/form-validation.js"></script>-->
		<script>
jQuery(document).ready(function() {
				//FormValidator.init();
jQuery.validator.addMethod("byteRangeLength", function(value) {
	var dropdown=$("#dropdown").val();
	var ret=true;
    if(dropdown>0){
       if(!value){
        ret=false;
       }
    }
  return ret;   
});

$("#form2").validate({
  rules: {
   title: "required",
   name: "byteRangeLength"
  },
  messages: {
   title: "请输入菜单名称",
   name: "请输入菜单地址"
  }
  });


$("#dropdown").change(function(){
	var val=$(this).val();
	if(val>0){
		$(".menu_icons").hide();
	}else{
		$(".menu_icons").show();
	}

});

});
		</script>
		<!-- end: JavaScript Event Handlers for this page -->
	</body>
</html>
